﻿using System;

namespace Medora.Services.Basic
{
    public class Translator
    {
        
        private static Translator _instance = null;
        private static readonly object locker = new object();

        
        public static Translator Instance
        {
            get
            {
                lock (locker)
                {
                    return _instance ?? (_instance = new Translator());
                }
            }
        }

        
        public string Translate(string key)
        {
            return Translate(key, key);
        }

        public string Translate(string key, string defaultValue)
        {
           // var text = (string)System.Web.HttpContext.GetGlobalResourceObject("Medora", key);
            var text = key;
            return !String.IsNullOrEmpty(text) ? text : defaultValue;
        }
    }
}